import { JSX } from "react";

export interface ItemProps {
  id: number;
  title: string;
  conversationId: string;
  content: string;
  updateTime: string;
  createTime: number;
}

// 定义统一响应结构
export interface ApiResponse<T = any> {
  body?: any;
  code: number;
  msg: string;
  data: T;
}

// 用户相关类型
export interface User {
  id: string;
  username: string;
  email?: string;
  roles: string[];
  createdAt?: string;
  updatedAt?: string;
}

// 用户信息类型（用于返回给客户端）
export interface UserInfo {
  id: string;
  username: string;
  email?: string;
  roles: string[];
}

// 认证相关类型
export interface LoginRequest {
  username: string;
  password: string;
}

export interface LoginResponse {
  access_token: string;
  token_type: string;
  user: User;
}
export interface Conversation {
  id: string
  user_id: number
  title: string
  is_archived: boolean
  tags: string
  last_message_time: string
  created_at: string
  updated_at: string

}

export interface LoginRes {
  access_token: string;
  token_type: string
  id: string
}

export interface MessageBase {
  id: number;
  conversation_id: number;
  role: string;
  content: string;
  token_count?: number;
  input_token_count?: number;
  model_name?: string;
  latency_ms?: number;
  meta_data?: string;
  created_at: Date;
  node: string;
}

export interface MessageData {
  [key: string]: MessageBase[];
}


export interface TexRes {
  id: number;
  title: string;
  node: string;
  model: string;
  text: string;
  remark: string;
  description: JSX.Element | undefined;
}